package com.qwz.learn;
/**
* @Description: 迭代器模式客户端
* @Package com.qwz.learn.Client
* @author Qiuwuzhi
* @date 2019/12/26 15:08
* @version V1.0
*/
public class Client {
    public static void main(String[] args) {
        String[] names = {"张三","李四","王五"};

        Aggregate aggregate = new ConcreteAggregate(names);

        Iterator iterator = aggregate.createIterator();
        iterator.first();
        while (!iterator.isDone()){
            Object o = iterator.currentItem();
            System.out.println("输出=>"+o);
            iterator.next();
        }
    }
}
